﻿@using RiderShop.Mobile.Common.Component
@model  RiderShop.Mobile.Modle.Purchase.OrderCompletedModel

@{
    var title = string.Empty;
    if (Model.ArrivePay)
    {
        title = "订单提交成功";
    }
    else
    {
        if (Request.QueryString["payonly"] != "1")
        {
            title = "订单提交成功， 请付款";
        }
        else
        {
            title = "请付款";
        }
    }
}

@section title
{
    @title
}
@section pagetitle
{
    @title
}

@section header
{
    <link rel="stylesheet" href="~/Themes/RongJi/Style/base/css/order.css">
    <style>
        /*.innerwrapper, .pageHeaderMini {
            display: none;
        }*/
        .pay_list .tbox > * {
            padding: 0;
        }

        .orderSuccess dl {
            padding: 50px 10% 30px;
        }

        /*.pay_list {
            text-align: left;
            border: 1px solid #ced3d7;
            margin: 10px 0;
            border-radius: 10px;
        }*/

        .tip {
            text-align: left;
        }
    </style>
}

@if (Model.ArrivePay)
{
    <div class="orderSuccess">
        <dl>
            <dt class="blue msg">
                <span class="icons"><img src="~/Themes/RongJi/Style/base/imgs/icon_de.png"></span>
                <i class="glyphicon glyphicon-ok"></i>

                <p class="f16">
                    订单提交成功，
                    <span>我们将安排尽快发货</span>
                </p>               
            </dt>

            <dd>
                <p><label>应付金额：</label><span class="orange f14">￥@Model.OrderPayAmount</span></p>

                <p><label>付款方式：</label><span class="blue f14">鲜享卡货到付款</span></p>

            </dd>
            <dd></dd>
            <dd>
                <p><span class="tip">配送：如果您的订单分别在多个商家购买，因此会根据商家拆分订单进行配送。给您造成不便，敬请谅解。</span></p>
            </dd>
            <dd class="btnLine">
                <a href="~/MyAccount/OrderList" data-role="button" class="btn btn-success">查看我的订单</a>
            </dd>
        </dl>
    </div>
}
else
{
            <!--情况1：在线支付-->
    <div class="box">
        <div class="groupbox">
            <div class="OtherTitle PaymentTypeDetail">
                <div class="TitleLeft mt10 f15"><i class="glyphicon glyphicon-chevron-right"></i>支付方式</div>
                <div class="TitleRight">
                    <div name="EditQtyAfter" class="ItemQtySpan">
                        <div class="ItemQty">
                            <span class="qtyLable">金额：</span>
                            <div id="Qty_11-119-225" class="QtyTable" style="color:red;padding-right:5px;">￥@Model.OrderPayAmount</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="ItemTable PaymentTypeDetail">
                <div class="ItemTableRight">
                    <div class="OtherProductItem">
                        <ul id="pay_list" class="pay_list on">

                            @if (Request.UserAgent.Contains("MicroMessenger"))
                            {
                                <li>
                                    <a href="@(string.Format(System.Configuration.ConfigurationManager.AppSettings["WeixinPayAddress"], Model.OrderNumber.Trim()))">

                                        <label class="tbox">
                                            <div>
                                                <span class="pay_weipay">&nbsp;</span>
                                            </div>
                                            <div>
                                                <p>微信支付</p>
                                                <p>推荐微信用户使用</p>
                                            </div>
                                        </label>
                                    </a>
                                </li>
                                <li>
                                    <a href="~/Purchase/Payment?orderNumber=@Model.OrderNumber.Trim()&orderType=1">
                                        <label class="tbox">
                                            <div>
                                                <span class="pay_alipay">&nbsp;</span>
                                            </div>
                                            <div>
                                                <p>支付宝</p>
                                                <p>推荐已开通支付宝的用户使用</p>
                                            </div>
                                        </label>
                                    </a>
                                </li>
                            }
                            else
                            {

                                <li>
                                    <a href="~/Purchase/Payment?orderNumber=@Model.OrderNumber.Trim()&orderType=1">
                                        <label class="tbox">
                                            <div>
                                                <span class="pay_alipay">&nbsp;</span>
                                            </div>
                                            <div>
                                                <p>支付宝</p>
                                                <p>推荐已开通支付宝的用户使用</p>
                                            </div>
                                        </label>
                                    </a>
                                </li>
                            }

                            <li>
                                <a href="~/Purchase/YinxinPay?orderNumber=@Model.OrderNumber.Trim()&orderType=1&cardType=xx">
                                    <label class="tbox">
                                        <div>
                                            <span class="pay_xianxiang">&nbsp;</span>
                                        </div>
                                        <div>
                                            <p>鲜享卡</p>
                                            @{
    var discountString = System.Configuration.ConfigurationManager.AppSettings["YinxinPayDiscount"];
                                            }
                                            @if (!string.IsNullOrEmpty(discountString))
                                            {
                                                if (discountString.Contains("%"))
                                                { 
                                                    <p style="color:#FF6C1F">支付立享 @discountString.Replace(",", " ") 折扣</p>
                                                }
                                                else
                                                {
                                                    <p style="color: #FF6C1F">支付满额立减 @discountString.Replace(",", " ")</p>
                                                }
                                            }
                                            else
                                            {
                                                <p>请使用鲜享卡在线支付</p>
                                            }
                                        </div>
                                    </label>
                                </a>
                            </li>

                            <li>
                                <a href="~/Purchase/YinxinPay?orderNumber=@Model.OrderNumber.Trim()&orderType=1&cardType=st">
                                    <label class="tbox">
                                        <div>
                                            <span class="pay_xianxiang" style="background: url(/Themes/RongJi/Style/base/imgs/st.jpg) no-repeat center 0">&nbsp;</span>
                                        </div>
                                        <div>
                                            <p>银信商通卡</p>
                                            <p>银信商通卡在线支付</p>
                                        </div>
                                    </label>
                                </a>
                            </li>

                            @*<ol class="show_all" onclick="$('#pay_list').addClass('on');">
                                    <a href="javascript:;" class="arrow">更多支付方式</a>
                                </ol>


                                <li>
                                    <label class="tbox">
                                        <div>
                                            <span class="pay_unionpay">&nbsp;</span>
                                        </div>
                                        <div>
                                            <p>银联全民付</p>
                                            <p>即将开通，尽请期待</p>
                                        </div>
                                        <div>
                                            <input type="radio" disabled="disabled" name="paytype" value="18705" class="radio">
                                        </div>
                                    </label>
                                </li>*@

                        </ul>
                    </div>
                </div>
            </div>

            <div class="OtherTitle">
                <div class="TitleLeft mt10 f15"><i class="glyphicon glyphicon-chevron-right"></i>支付说明</div>
            </div>
            <div class="ItemTable">
                <div class="OtherProductItem">
                    <div class="clearfix tip"><p>请在24小时付款，24小时后此订单将自动取消。</p></div>

                </div>
            </div>
        </div>
    </div>
}



@if (Model.IsPayCompleted)
{
    <script language="javascript" type="text/javascript">
        window.location = "PaymentCompleted" + "?orderNumber=" + @Model.OrderNumber;
    </script>
}
@section footer
{
    <script type="text/javascript" src="~/Utility/pages/pg_purchase.js"></script>

}
